package ipad.asia.service.impl;

import ipad.asia.dao.PunishEnterpriseDao;
import ipad.asia.entity.PunishEnterprise;
import ipad.asia.service.PunishEnterpriseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PunishEnterpriseServiceImpl implements PunishEnterpriseService {
    @Autowired
    private PunishEnterpriseDao punishEnterpriseDao;
    @Override
    public List<PunishEnterprise> findAll() {
        return punishEnterpriseDao.findAll();
    }

    @Override
    public PunishEnterprise findById(int id) {
        return punishEnterpriseDao.findById(id);
    }


    @Override
    public List<PunishEnterprise> findByShopId(int shopId) {
        return punishEnterpriseDao.findByShopId(shopId);
    }

    @Override
    public void waring(int id) {
        PunishEnterprise punishEnterprise=punishEnterpriseDao.findById(id);
        punishEnterpriseDao.save(punishEnterprise.setSerious(+1));
    }

    @Override
    public void save(PunishEnterprise punishEnterprise) {
        punishEnterpriseDao.save(punishEnterprise);
    }
}
